package com.projetIE.prudhomme_duisit.client;

/**
 * Please modify this class to meet your needs This class is not complete
 */

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.namespace.QName;

import com.projetIE.prudhomme_duisit.GetSituationRequest;
import com.projetIE.prudhomme_duisit.GetSituationResponse;
import com.projetIE.prudhomme_duisit.PostRequestRequest;
import com.projetIE.prudhomme_duisit.PostRequestResponse;
import com.projetIE.prudhomme_duisit.PrudhommeDuisit;
import com.projetIE.prudhomme_duisit.PrudhommeDuisit_Service;

/**
 * This class was generated by Apache CXF 2.1.4 Tue Oct 04 10:38:29 CEST 2011
 * Generated source version: 2.1.4
 * 
 */

public final class PrudhommeDuisit_PrudhommeDuisitSOAP_Client {
	
	private static final QName	SERVICE_NAME	= new QName(
	                                                 "http://www.projetIE.com/prudhomme_duisit/",
	                                                 "prudhomme_duisit");
	
	private PrudhommeDuisit_PrudhommeDuisitSOAP_Client() {
	}
	
	/**
	 * @param args
	 * @throws Exception
	 */
	public static void main(String args[]) throws Exception {
		URL wsdlURL = PrudhommeDuisit_Service.WSDL_LOCATION;
		if (args.length > 0) {
			File wsdlFile = new File(args[0]);
			try {
				if (wsdlFile.exists()) {
					wsdlURL = wsdlFile.toURI().toURL();
				} else {
					wsdlURL = new URL(args[0]);
				}
			} catch (MalformedURLException e) {
				e.printStackTrace();
			}
		}
		
		PrudhommeDuisit_Service ss = new PrudhommeDuisit_Service(wsdlURL, SERVICE_NAME);
		PrudhommeDuisit port = ss.getPrudhommeDuisitSOAP();
		
		System.out.println("Invoking postRequest...");
		PostRequestRequest _postRequest_parameters = new PostRequestRequest();
		_postRequest_parameters.setClient("0001");
		_postRequest_parameters.setPays("Spain");
		_postRequest_parameters.setVille("Madrid");
		PostRequestResponse _postRequest__return = port.postRequest(_postRequest_parameters);
		System.out.println("postRequest.result=" + _postRequest__return);
		
		System.out.println("Invoking getSituation 1 ...");
		GetSituationRequest _getSituation_parameters = new GetSituationRequest();
		_getSituation_parameters.setClient("0001");
		GetSituationResponse _getSituation__return = port.getSituation(_getSituation_parameters);
		while (_getSituation__return == null) {
			Thread.sleep(60 * 100);
			_getSituation__return = port.getSituation(_getSituation_parameters);
			
		}
		System.out.println("*********************************************");
		System.out.println("getSituation.result=" + _getSituation__return);
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getClient());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getPays());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getVille());
		System.out.println("*********************************************");
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getLieu());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getDateHeure());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVent());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVisibilite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getCiel());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getTemperature());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPointRosee());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getHumidite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPression());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getStatus());
		
		System.out.println("Invoking postRequest...");
		_postRequest_parameters = new PostRequestRequest();
		_postRequest_parameters.setClient("0001");
		_postRequest_parameters.setPays("Spain");
		_postRequest__return = port.postRequest(_postRequest_parameters);
		System.out.println("postRequest.result=" + _postRequest__return);
		
		System.out.println("Invoking getSituation 2 ...");
		_getSituation_parameters = new GetSituationRequest();
		_getSituation_parameters.setClient("0001");
		_getSituation__return = port.getSituation(_getSituation_parameters);
		while (_getSituation__return == null) {
			Thread.sleep(60 * 100);
			_getSituation__return = port.getSituation(_getSituation_parameters);
			
		}
		System.out.println("*********************************************");
		System.out.println("getSituation.result=" + _getSituation__return);
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getClient());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getPays());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getVille());
		System.out.println("*********************************************");
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getLieu());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getDateHeure());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVent());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVisibilite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getCiel());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getTemperature());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPointRosee());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getHumidite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPression());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getStatus());
		
		System.out.println("Invoking postRequest...");
		_postRequest_parameters = new PostRequestRequest();
		_postRequest_parameters.setClient("0001");
		_postRequest__return = port.postRequest(_postRequest_parameters);
		System.out.println("postRequest.result=" + _postRequest__return);
		
		System.out.println("Invoking getSituation 3 ...");
		_getSituation_parameters = new GetSituationRequest();
		_getSituation_parameters.setClient("0001");
		_getSituation__return = port.getSituation(_getSituation_parameters);
		while (_getSituation__return == null) {
			Thread.sleep(60 * 100);
			_getSituation__return = port.getSituation(_getSituation_parameters);
			
		}
		System.out.println("*********************************************");
		System.out.println("getSituation.result=" + _getSituation__return);
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getClient());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getPays());
		System.out.println("getSituation.result="
		        + _getSituation__return.getRequeteMeteo().getVille());
		System.out.println("*********************************************");
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getLieu());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getDateHeure());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVent());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getVisibilite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getCiel());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getTemperature());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPointRosee());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getHumidite());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getPression());
		System.out.println("getSituation.result="
		        + _getSituation__return.getReponseMeteo().getMeteo().getStatus());
		
	}
	
}
